export const filter = {
  highlight(text, keyword) {
    if (!keyword || !text) return text;
    const escapedKeyword = keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    const regex = new RegExp(escapedKeyword, 'gi');
    return text.replace(regex, match => `<span class="highlight">${match}</span>`);
  }
}